<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 85167
  Date: 2017/12/10
  Time: 11:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <c:import url="/WEB-INF/page/header.jsp"/>
</head>
<body>
<div class="col-md-12">
    <form id="cusForm" class="form-horizontal" action="${pageContext.request.contextPath}/admin/dictionary/save" method="post">
        <input type="hidden" name="id" value="${info.id}">
        <div class="form-group">
            <label class="col-sm-3 control-label">名称：</label>
            <div class="col-sm-9">
                <input type="text" name="name" class="form-control" placeholder="请输入名称" value="${info.name}" required=""
                       aria-required="true">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">CODE：</label>
            <div class="col-sm-9">
                <input type="text" name="code" class="form-control" placeholder="请输入链接" value="${info.code}" required=""
                       aria-required="true">
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-12 col-sm-offset-3">
                <button class="btn btn-primary" type="button" onclick="save()">保存</button>
                <button class="btn btn-white" type="button" onclick="cancel()">取消</button>
            </div>
        </div>
    </form>
</div>
<c:import url="/WEB-INF/page/footer.jsp"/>
<script type="text/javascript">
    $().ready(function () {
        $("#cusForm").validate();
    });


    function save() {
        saveData(base + "/admin/dictionary/save", $("#cusForm").serialize());
    }

    function cancel() {
        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        setTimeout(parent.layer.close(index), 2000);
        parent.location.reload(true);
    }
</script>
</body>
</html>
